dyn_size_of
is the Rust library by Piotr Beling to report approximate amount of memory consumed by variables,
including the memory allocated on heap.
Examples
Simple usage
use GetSize;
let bs = vec!.into_boxed_slice;
assert_eq!;
assert_eq!;
Implementing GetSize for a custom type
use GetSize;
// default implementation is fine for types that do not use heap allocations
// For types that use heap allocations:
let s = NoHeapMem ;
assert_eq!;
assert_eq!;
assert_eq!;
let d = WithHeapMem ;
assert_eq!;
assert_eq!;
assert_eq!;